<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="http://cdn.amazeui.org/amazeui/2.4.2/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="http://libs.baidu.com/jquery/2.0.3/jquery.min.js"></script>
<!--<![endif]-->
<script src="http://cdn.amazeui.org/amazeui/2.5.0/js/amazeui.min.js"></script>
<script src="__STATIC__/jquery.lazyload.min.js"></script>
<script>
    var haveData                    =   true;
	$(function(){
 		$('.article-list>ul>li').hover(
				function(){
					$(this).css('box-shadow','0px 2px 8px 3px #ccc');
				},
				function(){
					$(this).css('box-shadow','');
				}
			
		);
		$('.goods-list .item').hover(
				function () {
					$(this).addClass('hover');
				}, function () {
					$(this).removeClass('hover');
				}
		);
		$('.like').hover(
				function () {
					$(this).find('i').removeClass('am-icon-heart-o').addClass('am-icon-heart');
				}, function () {
					$(this).find('i').removeClass('am-icon-heart').addClass('am-icon-heart-o');
				}
		);
 		$('#go-top').click(function(){
 			$('html, body').animate({scrollTop:0}, 'slow');
 			$('.side_right .con').hide();
 			return false;
 		}); 
 		$(window).scroll(function () {
 			if ($(window).scrollTop() > 500) {
 				$('.side_right .go-top').show();
 			}else{
 				$('.side_right .go-top').hide();
 			}


            if ($(window).scrollTop() == $(document).height() - $(window).height()) {
                nextPage();
            }
 		});
 		$('.icon-like').click(function(){
 			 id = $(this).attr('data-id');
 			 that = $(this);
 			 $.get("{:U('Article/favor')}",{'id':id},function(json){
 	            showmsg(json.info);
 	            if(json.status == 1){
 	            	that.addClass('like');	
 	            }else{
 	            	that.removeClass('like');	
 	            }
 	  	  	});  
 		});
 		$('.lazy').lazyload( {
			effect : "fadeIn",
		    failure_limit : 12 
		});
	});

	function favor(goodsid){
		$.get("{:U('ajax/favor')}",{id:goodsid},function(json){
				showmsg(json.info);
		})
	}

	function updateCart(){
		target = "{:U('Cart/updateCart')}";
		$.post(target).success(function(data){
			if(data.errno == 0){
				$('.cart-number').html(data.count);
			}
		});
	}
	function setCookie(name,value)
	{
		var Days = 30;
		var exp = new Date();
		exp.setTime(exp.getTime() + Days*24*60*60*1000);
		document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
	}
	function getCookie(name)
	{
		var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
		if(arr=document.cookie.match(reg))
			return unescape(arr[2]);
		else
			return null;
	}
(function(){
    var bp = document.createElement('script');
    bp.src = '//push.zhanzhang.baidu.com/push.js';
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script><script src="__JS__/nayiya.js"></script>
<block name="script">
</block>




